import { createApp } from 'vue'
import App from './App.vue'
import '@/utils/permission.js'
import router from './router'
// import store from './store'
import { setupStore } from '@/store'
//引入mitt
import mitt from 'mitt'
const mitter = mitt()

import '@/assets/icons/iconfont.css' // 图标库
import '@/assets/icons/iconfont.js' // 图标库js
import './style/variable.less' // 变量
import './style/global.less' // 全局样式

// import './mock/index'
import ArcoVue from '@arco-design/web-vue'
import ArcoVueIcon from '@arco-design/web-vue/es/icon'
import '@arco-themes/vue-zczw-admin/index.less'
// 全局数据
import initGlobalData from '@/utils/initGlobalData'
import directive from '@/utils/directive' //自定义指令
const app = createApp(App)
setupStore(app)
app.use(router)
// app.use(store)
app.use(ArcoVue, {})
app.use(ArcoVueIcon)

//初始化全局数据
initGlobalData(app)
app.directive('noselect', directive.noselect) //禁止选中文字指令
app.mount('#app')

// 挂载到 app 上 后期可以使用$mitt
app.config.globalProperties.$mitt = mitter
